$OpenBSD: patch-bytesex_h,v 1.3 2015/05/01 17:40:58 ajacoutot Exp $
--- bytesex.h.orig	Sat Jun 18 08:40:22 2005
+++ bytesex.h	Sat Jun 18 08:42:22 2005
@@ -4,20 +4,17 @@
 
 /* $Id: patch-bytesex_h,v 1.3 2015/05/01 17:40:58 ajacoutot Exp $ */
 
+#include <endian.h>
+
 #ifndef ARS_BYTESEX_H
 #define ARS_BYTESEX_H
 
-#if 	defined(__i386__) \
-	|| defined(__alpha__) \
-	|| (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__)))
+#if 	BYTE_ORDER == LITTLE_ENDIAN
 #define BYTE_ORDER_LITTLE_ENDIAN
-#elif 	defined(__mc68000__) \
-	|| defined (__sparc__) \
-	|| defined (__sparc) \
-	|| defined (__PPC__) \
-	|| defined (__BIG_ENDIAN__) \
-	|| (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__)))
+
+#elif 	BYTE_ORDER == BIG_ENDIAN
 #define BYTE_ORDER_BIG_ENDIAN
+
 #else
 # error can not find the byte order for this architecture, fix bytesex.h
 #endif
